Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create generic task notifications #17835

Merged
merged 2 commits into from
Aug 24, 2018

Conversation

skateman
Copy link
Member

@skateman skateman commented Aug 10, 2018

These notifications types are intended to be use with provider-initiated tasks when there is a need to notify the user about the progress. The expires_in and audience values are just my assumptions and they might be wrong, this is one of the reasons why this is WIP.

I also added helper methods for initiating these notifications from models, you just have to include the NotificationMixin concern and you can use the notify_task(start|finish|fail|update) methods.

notify_task_xxx(_('your awesome message'), user_to_notify, optional_task_record)

If the last argument is omitted, the given record will be set as the notification subject automatically.

Related demo: ManageIQ/manageiq-providers-amazon#468

@miq-bot add_reviewer @martinpovolny

@miq-bot miq-bot added the wip label Aug 10, 2018
@skateman skateman changed the title [WIP] Create generic task notification types [WIP] Create generic task notifications Aug 13, 2018
@skateman
Copy link
Member Author

@miq-bot add_reviewer @Ladas

@miq-bot miq-bot requested a review from Ladas August 13, 2018 09:01
Copy link
Contributor

@Ladas Ladas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great start.

Going forward, we should be able to add link to notification (pointing to MiqTask, or the related entity)

@Ladas
Copy link
Contributor

Ladas commented Aug 13, 2018

@miq-bot assign @agrare
@miq-bot add_label enhancement

@skateman skateman changed the title [WIP] Create generic task notifications Create generic task notifications Aug 13, 2018
@miq-bot miq-bot removed the wip label Aug 13, 2018
@skateman skateman changed the title Create generic task notifications [WIP] Create generic task notifications Aug 13, 2018
@miq-bot miq-bot added the wip label Aug 13, 2018
@skateman
Copy link
Member Author

Can't really test this until the db:seed is broken... 😕

@skateman skateman changed the title [WIP] Create generic task notifications Create generic task notifications Aug 13, 2018
@miq-bot miq-bot removed the wip label Aug 13, 2018
@miq-bot
Copy link
Member

miq-bot commented Aug 13, 2018

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented Aug 22, 2018

This pull request is not mergeable. Please rebase and repush.

@Ladas
Copy link
Contributor

Ladas commented Aug 23, 2018

@skateman can you unwip this and rebase? I think this can get in

@skateman skateman changed the title [DEMO] Create generic task notifications Create generic task notifications Aug 23, 2018
@miq-bot
Copy link
Member

miq-bot commented Aug 23, 2018

Checked commits skateman/manageiq@2fd2c9a~...b936ca8 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 👍

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍 thanks @skateman

@agrare agrare added the core label Aug 24, 2018
@agrare agrare merged commit f64fa80 into ManageIQ:master Aug 24, 2018
@agrare agrare added this to the Sprint 93 Ending Aug 27, 2018 milestone Aug 24, 2018
@skateman skateman deleted the generic-task-notifications branch August 24, 2018 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants